package com.dongbo.recorder.screenrecord.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.dongbo.recorder.screenrecord.R;
import com.dongbo.recorder.screenrecord.bean.ScreenShotBean;

import java.io.File;

/**
 * @author GuoZi
 * @date :2020/5/4 14:43
 * @description:
 */
public class PicAdapter extends BaseQuickAdapter<ScreenShotBean, BaseViewHolder> {

    public PicAdapter() {
        super(R.layout.adapter_pic);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, ScreenShotBean data) {
        File file = new File(data.getPath());
        Glide.with(getContext()).load(file).into((ImageView) baseViewHolder.getView(R.id.pic_icon));
        baseViewHolder.setText(R.id.pic_name, data.getFlieName())
                .setText(R.id.pic_size, data.getSize());
    }
}
